﻿@using Subtle.Extensions;
@model Subtle.Areas.Administration.ViewModels.EditPostViewModel
@{
	ViewBag.Title = "Edit";
	Layout = "~/Areas/Administration/Views/Shared/_Layout.cshtml";
}
<h2>
	Edit</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
	wmd_options = { "output": "markdown", "height": 500 };
	Attacklab.wmd_defaults = { version: 1, output: "markdown", lineLength: 40, delayLoad: false };
</script>
<link href="@Url.Content("~/Scripts/Plugins/Markdown/wmd.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/Plugins/Markdown/showdown.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Plugins/Markdown/wmd.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
	@Html.ValidationSummary(true)
	@Html.HiddenFor(model => model.PublishDate)
	<div class="editor-label">
		@Html.LabelFor(model => model.Title)
	</div>
	<div class="editor-field">
		@Html.HiddenFor(model => model.ID)
		@Html.EditorFor(model => model.Title)
		@Html.ValidationMessageFor(model => model.Title)
	</div>
	<div class="editor-label">
		@Html.LabelFor(model => model.Body)
	</div>
	<div id="wmd-editor">
		@Html.TextAreaFor(model => model.Body, 10, 90, null)
		@Html.ValidationMessageFor(model => model.Body)
	</div>
	<div class="editor-label">
		@Html.LabelFor(model => model.Tags)
	</div>
	<div class="editor-field">
		@Html.EditorFor(model => model.Tags)
		@Html.ValidationMessageFor(model => model.Tags)
	</div>
	<div class="editor-label">
		@Html.LabelFor(model => model.CategoryDescription)
	</div>
	<div class="editor-field">
		@Html.EditorFor(model => model.CategoryDescription)
		@Html.ValidationMessageFor(model => model.CategoryDescription)
	</div>
	<div class="editor-label">
		@Html.LabelFor(model => model.Active)
	</div>
	<div class="editor-field">
		@Html.EditorFor(model => model.Active)
		@Html.ValidationMessageFor(model => model.Active)
	</div>
	<div class="wmd-preview">
	</div>
	<p>
		<input type="submit" value="Create" />
	</p>
}
<div>
	@Html.ActionLink("Back to List", "Index")
</div>
